sgdk: sram.h File Reference

sgdk

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

Defines | Functions
sram.h File Reference

SRAM (Static RAM used for save backup) support. More...

Go to the source code of this file.

## Defines

#define | SRAM_CONTROL 0xA130F1
#define | SRAM_BASE 0x200001

## Functions

void | SRAM_enable ()
| Enable SRAM in Read Write mode.
void | SRAM_enableRO ()
| Enable SRAM in Read Only mode.
void | SRAM_disable ()
| Disable SRAM.
u8 | SRAM_readByte (u32 offset)
| Read a byte from the SRAM.
u16 | SRAM_readWord (u32 offset)
| Read a word from the SRAM.
u32 | SRAM_readLong (u32 offset)
| Read a long from the SRAM.
void | SRAM_writeByte (u32 offset, u8 val)
| Write a byte to the SRAM.
void | SRAM_writeWord (u32 offset, u16 val)
| Write a word to the SRAM.
void | SRAM_writeLong (u32 offset, u32 val)
| Write a long to the SRAM.

## Detailed Description

SRAM (Static RAM used for save backup) support.

Author:
  Chilly Willy & Stephane Dallongeville

Date:
  08/2012

This unit provides methods to read from or write to SRAM.

## Function Documentation

u8 SRAM_readByte | ( | u32 | offset | ) |

Read a byte from the SRAM.

Parameters:

  offset | Offset where we want to read.

Returns:
  value.

u32 SRAM_readLong | ( | u32 | offset | ) |

Read a long from the SRAM.

Parameters:

  offset | Offset where we want to read.

Returns:
  value.

u16 SRAM_readWord | ( | u32 | offset | ) |

Read a word from the SRAM.

Parameters:

  offset | Offset where we want to read.

Returns:
  value.

void SRAM_writeByte | ( | u32 | offset,
|  | u8 | val
| ) |  |

Write a byte to the SRAM.

Parameters:

  offset | Offset where we want to write.
  val | Value wto write.

void SRAM_writeLong | ( | u32 | offset,
|  | u32 | val
| ) |  |

Write a long to the SRAM.

Parameters:

  offset | Offset where we want to write.
  val | Value wto write.

void SRAM_writeWord | ( | u32 | offset,
|  | u16 | val
| ) |  |

Write a word to the SRAM.

Parameters:

  offset | Offset where we want to write.
  val | Value wto write.

All Classes Files Functions Variables Typedefs Enumerations Defines